package com.xianniu.ltc.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xianniu.ltc.model.po.*;
import com.xianniu.ltc.model.po.imports.ImportAccountPO;
import com.xianniu.ltc.model.vo.XnAccountVO;
import com.xianniu.ltc.model.vo.XnAccountVO;
import com.xxl.sso.core.entity.ReturnT;

import java.util.List;

/**
 * @author WangRuiJie
 * @Title: XnAccountService
 * @Package com.xianniu.ltc.service
 * @Description: 客户管理
 * @date 2021/6/172:56 下午
 */
public interface XnAccountService {

    IPage<XnAccountVO> selectAccountForAdmin(QueryAccountAdminPO po);

    XnAccountVO detailAccount(String id);

    ReturnT transferAccountForAdmin(TransferAccountPO po);

    ReturnT deleteAccountForAdmin(List<String> idList);

    /**
     * 后台：客户回收站查询
     */
    IPage<XnAccountVO> selectAccountFallbackForAdmin(QueryAccountAdminPO po);

    /**
     * 后台：客户回收站还原
     */
    ReturnT resetAccountForAdmin(List<String> idList);


    /*************************************************************** 前台开始 ***************************************************************/

    /**
     * 公海查询客户
     * @param po
     * @return
     */
    IPage<XnAccountVO> selectAccountForHighSea(QueryAccountHighSeaPO po);

    /**
     * 公海删除客户
     * @param id
     * @return
     */
    ReturnT deleteAccountForHighSea(String id);

    /**
     * 公海分配客户
     */
    ReturnT assignAccountForHighSea(AssignAccountPO po);

    /**
     * 公海领取客户
     */
    ReturnT receiveAccountForHighSea(String id);

    /**
     * 新增公海客户
     * @param po
     * @return
     */
    ReturnT addAccountForHighSea(AddXnAccountPO po);

    /**
     * 私海查询客户
     * @param po
     * @return
     */
    IPage<XnAccountVO> selectAccountForPrivateSea(QueryAccountHighSeaPO po);

    /**
     * 新增私海客户
     * @param po
     * @return
     */
    ReturnT addAccountForPrivateSea(AddXnAccountPO po);

    /**
     * 私海放回客户池
     */
    ReturnT putBackAccountForPrivateSea(PutAccountPO po);

    /**
     * 强制回收客户到客户池
     */
    ReturnT recycleAccountForPrivateSea(PutAccountPO po);

    /**
     * 前台私海-锁定/解锁客户
     */
    ReturnT lockAccountForPrivateSea(String id);

    /**
     * 保存导入的客户数据
     * @param excelList
     * @param tenantCode
     * @return
     */
    Integer saveImportAccount(List<ImportAccountPO> excelList, String tenantCode) throws Exception;

    /**
     * 线索管理：查询导出的客户数据
     * @param queryData
     * @return
     */
    List<XnAccountVO> selectExportAccountForAdmin(JSONObject queryData, Integer dr);
}
